'use strict'

define(['jquery', 'bootstrap', 'select2', 'datetimepicker', 'datetimepickerCN',
        'shiftform', 'validate', 'validate.en'], function($) {
    return {
        init: function() {
            this.initPage();
        },
        
        initPage: function(){
            $('select[name="siteId"]').select2({
                minimumResultsForSearch : -1,
                allowClear : true,
                width: '150'
            });
            
            $('select[name="coachId"]').select2({
                placeholder: '请选择教练',
                minimumResultsForSearch : 5,
                allowClear : true
            });
            
            $('select[name="roundStatus"]').select2({
                placeholder: '请选择课程状态',
                minimumResultsForSearch : -1,
                allowClear : true
            });
            
            $('a.x-btn').click(function(){
                $("#courseType").val($(this).attr("id"));
                $("#rounds-search-form").submit();
            });
            
            $('#sub_btn').click(function(){
                $("#courseType").val('');
                $("#rounds-search-form").submit();
            });
        }
    }
})
